<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
  <link rel="stylesheet" href="../css/index.css">
  <link rel="stylesheet" href="../css/skinList.css">
  <title>皮肤记录</title>
</head>

<body class="skinList page-group">
  <div class="page">
    <!-- //<header class="bar bar-nav" id="golbalHeader"></header> -->

    <!-- 这里是页面内容区 -->
    <div class="content">
      <div class="content-block">
        <div class="card-content">
          <div class="list-block media-list">
            <ul>
              
            </ul>
            <p class="moreInfo" onclick="skinList.loadMore()"></p>
          </div>
        </div>
        
      </div>
    </div>

  </div>
  <!-- 底部 -->
  <!-- <nav class="bar bar-tab" id="golbalFooter"></nav> -->
  <div id="modal">
    <li class="item-content">
      <div class="item-media">
        <img src=""
          width="44">
      </div>
      <div class="item-inner">
        <div class="item-title-row">
          <div class="item-title flex-box"><span class="label">皮肤值</span><span class="skinValue value"></span>
          </div>
        </div>
        <div class="item-title flex-box"><span class="label">皮肤信息</span><span class="skinInfo value"></span>
        </div>
      </div>
    </li>
  </div>
  </div>
  <!-- 标题栏 -->

</body>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
  var skinList = (function ($) {
    $.init()
    var skinList = new ST({
      golbalHeaderText: '皮肤记录',
      golbalHeaderFunc: function () {
        window.history.back()
      },
      skinList:{
        page:1,
        pageSize:5
      }
    })
    skinList.loadMore = function () {
      skinList.skinList.page ++
      skinList.http('getSkinList')
    }
    skinList.pushAjax({
      getSkinList:{
        url:'/app/api/private/skin/skinList',
        data:skinList.skinList
      }
    })
    skinList.pushAjaxSuccess({
      getSkinList:function (res) {
        if(res.code === '1'){
          res.data.skinList.forEach(function (ele) {
            var li = $('#modal li').clone()
            $(li).find('img').attr('src',ele.skinImg)
            $(li).find('.skinValue').text(ele.skinValue)
            $(li).find('.skinInfo').text(ele.skinInfo)
            $(li).appendTo($('ul'))
          })
          if(res.data.skinList.length < 5) {
            $('.moreInfo').text('没有更多数据')
          }else{
            $('.moreInfo').text('点击加载更多')
          }
        }
      }
    })

    skinList.http('getSkinList')
    skinList.render()

    return skinList
  })($)
</script>

</html>